To add more images to other sprites, you assign group IDs to those images, using the AssignImageGroupIDsToKeyFrame function. You then create the sprite track, add it to theMovie , and then begin to add samples to the tracks' media, as shown in Listing 3-4 .
Listing 4 Adding more images to other sprites and specifying button actions
// assign group IDs to the images
AssignImageGroupIDsToKeyFrame(mySample);
// add samples to the sprite track's media
//
BeginMediaEdits(myMedia);
// go to beginning button with no actions
myErr = QTNewAtomContainer(&myBeginButton);
if (myErr != noErr)
goto bail;
myLocation.h = (1 * kSpriteTrackWidth / 8) - (kStartEndButtonWidth
/ 2);
myLocation.v = (4 * kSpriteTrackHeight / 5) -
(kStartEndButtonHeight / 2);
isVisible = false;
myLayer = 1;
myIndex = kGoToBeginningButtonUpIndex;
myErr = SetSpriteData(myBeginButton, &myLocation, &isVisible,
&myLayer, &myIndex, NULL, NULL, myActions);
if (myErr != noErr)
goto bail;
| Previous | Chapter Contents | Chapter Top | Next |